The invention relates to a method for programming a controller, in particular in a motor vehicle, which is switched from the operating mode to the programming mode by means of a signal which is supplied externally to the controller.
DE 37 17 012 A1 discloses a method for programming a digital controller. This controller is provided with a diagnosis interface, via which the controller is supplied with a signal, in which case this signal causes the controller to switch from an operating mode to a programming mode.
In order to report to the controller that there is a wish to switch from the operating mode to the programming mode, the signal must be applied to the diagnosis interface for at least 2.5 seconds. A further precondition is that the vehicle is not in motion during controller switching. The vehicle speed is thus detected, and reprogramming is allowed only when the vehicle is stationary.
However, the described method does not offer sufficient security to prevent the controller from being reprogrammed by unauthorized personnel.
The invention is thus based on the object of specifying a method for programming a controller which ensures adequate protection against unauthorized reprogramming of the controller, and is nevertheless simple to handle.
This object is achieved according to the invention in that the external signal is used to produce switching information in a programmable read only memory, which stores at least one operating program and/or data (which is updated at predetermined intervals) for the controller and causes the changeover to the programming mode when the controller is activated.
The advantage of the invention is that, as a result of this simple measure, information is stored which is identified after the controller has been switched off and switched on again, and is used to switch the controller to the operating mode. This is advantageous in particular if the operating voltage fails.
Particularly with regard to permanent data storage in motor vehicles, it is necessary to edit current operating data and programs continually. In this case, the method offers a convenient capability for switching the controller from the operating mode to the programming mode, with optimum utilization of memory devices included in the controller.
The signal for switching the controller advantageously changes the contents of a memory location in the programmable read only memory. There is no need to input complicated access codes and to interrogate them, since the switching signal can be produced only by special hardware.
One particularly simple option for inputting switching information into the programmable read only memory is to change a diagnosis bit, which is present in the programmable read only memory in any case, and to produce the switching information in this way.
After completion of the programming process, the switching information is automatically deleted from the programmable read only memory by the computer in the controller, by resetting the diagnosis bit to its original state again.
In a development, once the controller has identified the switching information, a program loading algorithm which is present in any case in the controller is activated, and a new operating program for the controller is then read from an external arithmetic unit.
In a further refinement of the invention, the device for programming a controller, in particular in a motor vehicle, has a controller which is provided with an arithmetic unit, in which case the arithmetic unit is connected to a programmable read only memory and to a diagnosis interface, with a signal for switching the controller from the operating mode to the programming mode being supplied to the controller via the diagnosis interface.
According to the invention, the signal for switching the controller to the programming mode produces switching information in the programmable read only memory which is connected via the arithmetic unit to the diagnosis interface and stores at least one operating program and/or data (which is updated at predetermined intervals) for the controller, in which case, once the arithmetic unit has been activated, the switching information is read by the arithmetic unit in the programmable read only memory and, once the switching information has been read, the programming mode is started.
By storing the switching information in the programmable read only memory, which is present for other purposes in any case, memory locations in other data memories in the arithmetic unit are not used. In particular, the use of the diagnosis bit reduces the need for memory space to a minimum. There is no need for any additional complexity for encrypting the switching information.
The signal for switching the controller is advantageously produced by means of a diagnosis apparatus which is present in any case.
After setting the programming mode, a new operating program for the controller is initially transferred to a random access memory of the arithmetic unit and, after deletion of those memory locations in the programmable read only memory which contain a previous operating program, the new operating program is then transferred to the programmable read only memory.
Once the transfer to the programmable read only memory has been carried out, the memory locations in the random access memory are in this case advantageously deleted, and can be used for other controller operating sequences.
In a refinement, we transfer the new operating program from an external arithmetic unit via a controller matching unit to the controller to be programmed. In this way, the new operating program can be produced, for example, in a PC, with the complete program being transferred to the controller only after the work has been completed.
In a refinement, the controller matching unit is freely configurable for matching to different interfaces and bus systems. This has the advantage that, depending on the architecture of the controller, there is no need to produce a matching circuit as an extra item for each controller, since the correct matching can be produced easily by software, by means of simple links within the controller matching unit for each controller.
The invention allows numerous embodiments. One of these will be explained in more detail with reference to the figures illustrate d in the drawings, in which: